#include <bits/stdc++.h>
using namespace std;
class Solution
{
  public:
    int search(vector<int> &nums, int target)
    {
        int n = nums.size();
        int left = 0;
        int right = n - 1;

        while (left <= right)
        {
            if (nums[(left + right) / 2] == target)
            {
                return (left + right) / 2;
            }
            if (nums[(left + right) / 2] > target)
            {
                right = (left + right) / 2 - 1;
            }
            else
            {
                left = (left + right) / 2 + 1;
            }

            if (left >= right)
            {
                return -1;
            }
            // write code here
        }
    }
};
int main()
{
    
}